package com.keshe.member.service.impl;

import com.keshe.member.entity.UserEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.keshe.common.utils.PageUtils;
import com.keshe.common.utils.Query;

import com.keshe.member.dao.AddressDao;
import com.keshe.member.entity.AddressEntity;
import com.keshe.member.service.AddressService;


@Service("addressService")
public class AddressServiceImpl extends ServiceImpl<AddressDao, AddressEntity> implements AddressService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {

        System.out.println(params.get("user_id"));
        //    获取key
        String userId = (String)params.get("user_id");
        System.out.println(userId);

        QueryWrapper<AddressEntity> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId);

        IPage<AddressEntity> page = this.page(
                new Query<AddressEntity>().getPage(params),
                queryWrapper
        );

        return new PageUtils(page);
    }

}

